<%@ page language="java"  pageEncoding="utf-8"%>
<%@ page import="java.util.Vector,com.ejoysoft.wlanyz.system.SignalPara,com.ejoysoft.common.Constants,com.ejoysoft.common.exception.NoRightException" %>
<%@ include file="../include/jsp/head.jsp"%>
<%
if(!globa.userSession.hasRight("50040"))
      throw new NoRightException("用户不具备操作该功能模块的权限，请与系统管理员联系！");
     
%>

<%
   String strParaName = ParamUtil.getString(request,"strParaName","").trim();
    //初始化
    SignalPara  obj0=null;
    SignalPara obj=new SignalPara(globa);
    //查询条件

    String tWhere=" where 1=1 ";
     if(strParaName.equals("射线条数"))
    {tWhere += " and para_name = 'rays' ";
    }
    if(strParaName.equals("渲染方格数"))
    {tWhere += " and para_name = 'cells' ";
    }
    if(strParaName.equals("非可视区域最大空间"))
    {tWhere += " and para_name = 'invisible' ";
    }
    if(strParaName.equals("信号衰减阈值"))
    {tWhere += " and para_name = 'attenuation' ";
    }
	//记录总数
	int intAllCount=obj.getCount(tWhere);	
	//当前页
	int intCurPage=globa.getIntCurPage();
	//每页记录数
	String strPageSize = ParamUtil.getString(request,"strPageSize","10");
    int intPageSize;
    if(strPageSize.equals("所有"))intPageSize = intAllCount;
      else  intPageSize = Integer.parseInt(strPageSize);
	//共有页数
 	int intPageCount=(intAllCount-1)/intPageSize+1;
	// 循环显示一页内的记录 开始序号
	int intStartNum=(intCurPage-1)*intPageSize+1;
	//结束序号
	int intEndNum=intCurPage*intPageSize;   
	//获取到当前页面的记录集

	Vector<SignalPara> vctObj=obj.list(tWhere,intStartNum,intPageSize);
	//获取当前页的记录条数
	int intVct=(vctObj!=null&&vctObj.size()>0?vctObj.size():0);
%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
  <head>
<link href="../css/main.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><style type="text/css">
<!--
body {
	background-color: #f2f8ff;
}
.sel1{ width:160px;}
.STYLE1 {color: #FF0000}
.s6 a:link{ line-height:25px;height:25px; color:#333333}
.s6 a:hover{ line-height:25px;height:25px; color:#333333}
-->
</style>
    <!--<script src="../jquerytable/Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="../jquerytable/Scripts/JQueryPlugin/TableSort.js" type="text/javascript"></script>
    <script language="JavaScript" src="../include/date/popc.js"></script>
	
    <script type="text/javascript">
        $(function () {
            $("#tb").sorttable({
                ascImgUrl: "../jquerytable/Images/bullet_arrow_up.png",
                descImgUrl: "../jquerytable/Images/bullet_arrow_down.png",
                ascImgSize: "8px",
                descImgSize: "8px",
                sorttingMsg: "数据加载中...",
                sorttingMsgColor: "#FF6600",
                 maskOpacity: "0.6",
                 maskColor:"#D2F1FF",
                onSorted: function (cell) {
                  //  alert(cell.index() + " -- " + cell.text());
                }
            });
        });
    </script>-->
    <script src="../include/js/list.js"></script>
<script type="text/javascript">
 function showAc(){ 
  frm.action="signalpara_list.jsp";
  // document.getElementById(<%=Constants.PAGE_SIZE_INDEX%>).value = "1"; //chrome浏览器不兼容。。
  frm.<%=com.ejoysoft.common.Constants.PAGE_SIZE_INDEX%>.value = "1";
  frm.submit();
 }
 function add() {
   frm.action="signalpara_add.jsp";
   frm.submit();
}
 function del(){
	if (iCheckedNumber(document.all.strId) == 0) {
		alert("请先选择要删除的记录！");
		return;
	}
    if(!confirm('您是否确认要删除所选中的所有记录？'))
        return;
     frm.action="signalpara_act.jsp?<%=Constants.ACTION_TYPE%>=<%=Constants.DELETE_STR%>";
     frm.submit();
} 
  function export_sbm(page){ 
  frm.action="signalpara_export.jsp";
  document.getElementById("strCurPage").value = "<%=intCurPage%>";
  document.getElementById("exportContent").value = page;
  frm.submit();
 }
</script>

</head>


<body>

<form name="frm" METHOD=POST ACTION="signalpara_list.jsp">

<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><img src="../images/ri_list.jpg" width="14" height="14" align="absbottom" />&nbsp;您现在所在的位置：<font color="#0e7cc9">系统配置</font> &gt; 参数管理</td>
  </tr>
</table>
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
  
  <tr>
    <td height="45" valign="middle" bgcolor="e1eef7">
      <table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="89%">无线信号强度覆盖范围相关参数：
          <input type="text" name="strParaName"  value="<%=strParaName %>" />
          <img src="../images/search.jpg" width="58" height="28" align="absmiddle" onclick="showAc()" style="cursor:hand"/></td>
          <td width="11%" align="right"><img src="../images/add.jpg" width="64" height="27" onclick="add()"style="cursor:hand"/></td>
        </tr>
      </table></td>
  </tr>
</table>
<br>
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>
    
    <td width="13%" class="listtit" style="border-left:1px solid #32a4ea;">参数名</td>
    <td width="8%" class="listtit">参数值</td>
    <td width="17%" class="listtit">基本操作</td>
  </tr>
   <%
            String paraname="";
            String paraname1="";
            for (int i = 0;i < vctObj.size(); i++) {
            	SignalPara obj1 = vctObj.get(i); 
            	paraname1=  obj1.getParaName();
            	if(paraname1.equals("rays")){paraname= "射线条数";int paravalue = (int)obj1.getParaValue();}
            	if(paraname1.equals("cells")){paraname="渲染方格数";int paravalue = (int)obj1.getParaValue();} 
            	if(paraname1.equals("invisible")){paraname=  "非可视区域最大空间";int paravalue = (int)obj1.getParaValue();}
            	if(paraname1.equals("attenuation"))paraname="信号衰减阈值";   
            %>
  <tr>
    <td class="listd1" style="border-left:1px solid #dddddd;"><%=paraname %></td>
    <td class="listd1"><%if(!paraname1.equals("attenuation")) {%><%=(int)obj1.getParaValue() %><%} %><%else {%><%=obj1.getParaValue() %><%} %></td>
    <td class="listdrd" style="border-right:1px solid #dddddd;"> <img src="../images/mid.jpg" width="12" height="12" align="absmiddle" /> <a href="signalpara_update.jsp?strId=<%=obj1.getStrId()%>">修改</a> <img src="../images/del.jpg" width="11" height="11" align="absmiddle" /> <a href="#" onclick="if(confirm('确认删除该记录？')){location.href='signalpara_act.jsp?<%=Constants.ACTION_TYPE%>=<%=Constants.DELETE_STR%>&strId=<%=obj1.getStrId()%>';}">删除</a></td>  </tr>
          <%
            }//for
         %> 
</table>

<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="61%" height="50" valign="bottom">&nbsp;&nbsp; 
      <!--<select name="strPageSize" id="strPageSize" style="width:52px;" onchange="showAc()">
		<% 
		 String sltOpt[] = {"10","20","30","50","70","100","所有"};
		 for(int i=0; i < sltOpt.length;i++){
		 	String selected = "";
		    if(sltOpt[i].equals(strPageSize))
		      selected="selected='selected'";
		%>
		 <option value="<%=sltOpt[i] %>" <%=selected %>><%=sltOpt[i] %></option>
   		<%
   		 }
   		 %>  
   		 </select>
   --></td>
    <td width="39%" align="right" valign="bottom"><table width="310" border="0" cellspacing="0" cellpadding="0">
    	<!-- 翻页开始 -->  
     	<%@ include file="../include/jsp/cpage.jsp"%>
       	<!-- 翻页结束 --> 
    </table></td>
  </tr>
</table>

    </form>
</body>
</html>
<%@ include file="../include/jsp/footer.jsp"%>